<template>
  <div class="app-container">
    <MyHeader :title="title" />
    <!-- 渲染并传值 -->
    <MyGoods v-for="item in list" :key="item.id" :goods="item"/>
    <MyFooter :list="list"/>
    <!-- goods_count  goods_img   goods_name  goods_price  goods_state  id -->
  </div>
</template>

<script>
import MyHeader from "./components/MyHeader.vue";
import MyGoods from "./components/MyGoods.vue";
import MyFooter from "./components/MyFooter.vue";
export default {
  name: "ShopcarApp",
  components: {
    MyHeader,
    MyGoods,
    MyFooter,
  },
  /* 发送axios */
  async created() {
      let res =await this.$axios({
          url:'/api/cart'
      })
      this.list=res.data.list

  },
  data() {
    return {
        title:'购物车',
        list:[]
    };
  },

  mounted() {},

  methods: {},
};
</script>

<style lang="less" scoped>
.app-container {
  padding: 45px 0 50px 0;
}
</style>